package com.zhentao.controller;

import com.zhentao.model.article.dto.ArticleHomeDto;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.impl.ArticleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 *云计算
 *魏子纹
 *2025/6/9
 */
@RestController
@RequestMapping("/api/v1/article")
public class ApArticleHomeController {

    @Autowired
    private ArticleServiceImpl articleService;

    @PostMapping("/load")
    public ResponseResult load(@RequestBody ArticleHomeDto dto){
        return articleService.load(0,dto);
    }

    @PostMapping("/loadmore")
    public ResponseResult loadmore(@RequestBody ArticleHomeDto dto){
        return articleService.load(1,dto);
    }

    @PostMapping("/loadnew")
    public ResponseResult loadnew(@RequestBody ArticleHomeDto dto){
        return  articleService.load(2,dto);
    }
}
